tramp: Tweak the ls-lisp declarations
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 4 Feb 2024 04:05:03 +0000 (23:05 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 4 Feb 2024 04:05:03 +0000 (23:05 -0500)
* lisp/net/tramp-sh.el (ls-lisp-use-insert-directory-program): Don't
declare its existence...
(tramp-sh-handle-insert-directory): ...test it instead.

* lisp/net/tramp.el (ls-lisp-dirs-first, ls-lisp-emulation)
(ls-lisp-ignore-case, ls-lisp-use-insert-directory-program)
(ls-lisp-verbosity): Move declaration...
(tramp-handle-insert-directory): ...to the point where we have a good
reason to think these variables exist.

lisp/net/tramp-sh.el
lisp/net/tramp.el

index 6bb1d976ec58397769655d8bed850f82647b36ce..7656da81dccda2d0687bd699a77e8eb4b05b6917 100644 (file)
@@ -38,7 +38,6 @@
 (declare-function dired-compress-file "dired-aux")
 (declare-function dired-remove-file "dired-aux")
 (defvar dired-compress-file-suffixes)
-(defvar ls-lisp-use-insert-directory-program)
 ;; Added in Emacs 28.1.
 (defvar process-file-return-signal-string)
 (defvar vc-handled-backends)
@@ -2636,7 +2635,7 @@ The method used must be an out-of-band method."
 (defun tramp-sh-handle-insert-directory
     (filename switches &optional wildcard full-directory-p)
   "Like `insert-directory' for Tramp files."
-  (if (and (featurep 'ls-lisp)
+  (if (and (boundp 'ls-lisp-use-insert-directory-program)
           (not ls-lisp-use-insert-directory-program))
       (tramp-handle-insert-directory
        filename switches wildcard full-directory-p)
index 74d95757e46a53b256654ec9f59d22a07f39f210..7800efc2a5e5455b2bd190526c2b04231d81528a 100644 (file)
 (declare-function file-notify-rm-watch "filenotify")
 (declare-function netrc-parse "netrc")
 (defvar auto-save-file-name-transforms)
-(defvar ls-lisp-dirs-first)
-(defvar ls-lisp-emulation)
-(defvar ls-lisp-ignore-case)
-(defvar ls-lisp-use-insert-directory-program)
-(defvar ls-lisp-verbosity)
 (defvar tramp-prefix-format)
 (defvar tramp-prefix-regexp)
 (defvar tramp-method-regexp)
@@ -4189,6 +4184,11 @@ Let-bind it when necessary.")
     (filename switches &optional wildcard full-directory-p)
   "Like `insert-directory' for Tramp files."
   (require 'ls-lisp)
+  (defvar ls-lisp-dirs-first)
+  (defvar ls-lisp-emulation)
+  (defvar ls-lisp-ignore-case)
+  (defvar ls-lisp-use-insert-directory-program)
+  (defvar ls-lisp-verbosity)
   (unless switches (setq switches ""))
   ;; Mark trailing "/".
   (when (and (directory-name-p filename)